""" 自定义 校验器 """

import re


def is_valid_email(email: str) -> bool:
    """ 判断邮箱是否合法 """

    email_regex = r"^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$"

    return re.match(email_regex, email) is not None


def is_valid_phone(phone: str) -> bool:
    """ 判断手机号是否合法 """

    phone_regex = r"^1\d{10}$"

    return re.match(phone_regex, phone) is not None
